import instance from "./request"
import QS from 'qs'
// 获取验证码请求
export const GetCaptchaCodeApi = () => instance.get("/prod-api/captchaImage");

// 登录请求
export const LoginApi = (params) => instance.post("/prod-api/login", params);

// 获取用户可以访问的路由的api
export const GetUserRoutersApi = () => instance.get("/prod-api/getRouters");

// 获取用户信息
export const GetUserInfoApi = (params) => instance.get("/prod-api/getInfo",{params});

// 获取客户管理-客户信息
export const  GetCustomeroApi = (params)=> instance.get("/prod-api/customer",{params});

//  修改个人信息
export const GetChangeInfoApi = (params) => instance.put(`/prod-api/system/user/profile`,params);

//  搜索
export const searChCustomer = (params) => instance.get("/prod-api/customer",{params});
// 修改密码
export const GetChangePwdApi = (params) => instance.put(`/prod-api/system/user/profile/updatePwd?oldPassword=${params.oldPassword}&newPassword=${params.newPassword}`);
// 修改客户信息
export const updateCustomer = (params) => instance.put(`/prod-api/customer`, params);
//添加用户
export const addCustomer = (params) => instance.post(`/prod-api/customer`,params);

// 修改头像
export const GetAvatarImgApi = (params) => instance.post("/prod-api/system/user/profile/avatar", params);


// 导出为Excell表格
export const exportExl = (params) => instance.post("/prod-api/customer/export",params);

// 获取流程管理的列表
export const getDefineList = (params) => instance.get("/prod-api/business/bpmnInfo",{params});

// 流程文件查看
export const bpmnInfo = (type,id) => instance.get(`/prod-api/business/bpmnInfo/${type}/${id}`);


// 上传流程文件
export const addBpmnInfo = (params) => instance.post("/prod-api/business/bpmnInfo",params);


// 服务项
export const GetServiceItemApi = (params) =>
{
    return instance.get("/prod-api/business/serviceItem",
    {params:params});
} 

// 结算单
export const GetStatementApi = (params) =>
{
    return instance.get("/prod-api/business/statement",
    {params:params});
} 

// 预约信息
export const GetAppointmentApi = (params) =>
{
    return instance.get("/prod-api/business/appointment",
    {params:params});
} 

// 预约信息搜索
export const searchCustomeroApi = (params) => instance.get("/prod-api/business/appointment",{params});

// 结算单搜索
export const searchStatementApi = (params) => instance.get("/prod-api/business/statement",{params});

// 服务项搜索
export const searchServiceItemApi = (params) => instance.get("/prod-api/business/serviceItem",{params});

// 上架与下架
export const shangjia = (id) => instance.put(`/prod-api/business/serviceItem/saleOn/${id}`);
export const xiajia = (id) => instance.put(`/prod-api/business/serviceItem/saleOff/${id}`);

// 添加数据到预约信息
export const appointmentApi = (params) => instance.post("/prod-api/business/appointment", params);

// 服务项添加
export const addServiceItemApi = (params) => instance.post("/prod-api/business/serviceItem", params);

// 结算单添加
export const addStatementApi = (params) => instance.post("/prod-api/business/statement", params);

// 获取用户信息    注意get的传参后面必须加上{}    axios get方法参数必须是params;post的话就不用必须是
export const GetCustomerListApi = (params) => instance.get("/prod-api/customer", { params });

export const GetCustomervisitApi = (params) => instance.get("/prod-api/customer/visit", { params });

// 修改用户信息
export const GetprodapicustomerApi = (params) => instance.post("/prod-api/customer", params);